home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
bell.dir
/
00170_Script_Induction Balance Object
< prev
next >
Wrap
Text File
|
1997-05-26
|
3KB
|
100 lines
--Induction Balance Object
--Instantiated as gInductionBalanceObj
property pDisplayingPaddle
property pPICTsprite, pPaddleSprite, pFirstMetalHS, pLastMetalHS
property pPlaceHolderCastNum, pPaddleCastNum, pBeepCastNum
property pBoundaryRect
global gUtilityObj, gInterfaceMgrObj
-----------------------------------------------------------------<<ò>>
on mInit me
mPlayVO( gUtilityObj, "BIBINTR.AIF" )
set pPICTsprite = 2
set pPaddleSprite = 20
set pFirstMetalHS = 3
set pLastMetalHS = 16
set pPlaceHolderCastNum = the number of cast "Induction Placeholder"
set pPaddleCastNum = the number of cast "BIBPDL1.PIC"
set pMetalHScastNum = the number of cast "MetalHS"
set pBeepCastNum = the number of cast "BIB.AIF"
set pBoundaryRect = rect(60, 80, 420, 440)
return me
end mInit
-----------------------------------------------------------------<<ò>>
on mActivate me
puppetSprite pPaddleSprite, true
set pDisplayingPaddle = false
mSetToolBtns (gInterfaceMgrObj,#Induction, me)
end mActivate
-----------------------------------------------------------------<<ò>>
on mClose me
puppetSprite pPaddleSprite, false
cursor 0
end mClose
-----------------------------------------------------------------<<ò>>
on mPerform me
set mousePoint = point(the mouseH, the mouseV)
if inside(mousePoint, pBoundaryRect) then
if not pDisplayingPaddle then mDisplayPaddle(me)
mUpdatePaddleLoc(me)
else if pDisplayingPaddle then mHidePaddle(me)
updateStage
go the frame
end mPerform
-----------------------------------------------------------------<<ò>>
on mDisplayPaddle me
cursor 200
set pDisplayingPaddle = true
set the castNum of sprite pPaddleSprite = pPaddleCastNum
end mDisplayPaddle
-----------------------------------------------------------------<<ò>>
on mHidePaddle me
set pDisplayingPaddle = false
set the castNum of sprite pPaddleSprite = pPlaceHolderCastNum
set the locH of sprite pPaddleSprite = -500
cursor 0
end mHidePaddle
-----------------------------------------------------------------<<ò>>
on mUpdatePaddleLoc me
set SpriteToCheck = pFirstMetalHS
set OnAMetalObject = false
set Done = false
repeat while not Done and (SpriteToCheck < pLastMetalHS)
if rollover(SpriteToCheck) then
set OnAMetalObject = true
set Done = true
else set SpriteToCheck = SpriteToCheck + 1
end repeat
if OnAMetalObject and not mSndEffectActive( gUtilityObj) then mPlaySndEffect( gUtilityObj, pBeepCastNum )
else if not OnAMetalObject then mStopSndEffect( gUtilityObj)
set the locH of sprite pPaddleSprite = the mouseH
set the locV of sprite pPaddleSprite = the mouseV
end mUpdatePaddleLoc
-----------------------------------------------------------------<<ò>>
on mOperate me
mDisplayPaddle me
end mOperate
-----------------------------------------------------------------<<ò>>